﻿using Engine.Graphics;
using Scenario_Editor.AddinManager;
using System;
using System.Windows.Forms;

namespace Cobra11Undercover.Material
{
    internal partial class MaterialEditControl : UserControl, IMaterialEditorControl
    {
        #region Private Fields

        private C11Material CurrentMaterial;

        private Engine.Graphics.MaterialManager materialManager;

        #endregion Private Fields

        #region Public Constructors

        public MaterialEditControl()
        {
            InitializeComponent();
        }

        #endregion Public Constructors

        #region Public Events

        public event EventHandler MaterialChanged;

        #endregion Public Events

        #region Public Methods

        public IMaterial CreateMaterialFromTextureName(string textureName)
        {
            return new C11Material(textureName, textureName, textureName, EnumMappingMode.material32, this.materialManager);
        }

        public IMaterial GetMaterial()
        {
            return new C11Material(10, 10, 0, EnumMappingMode.material00, this.materialManager);
        }

        public IMaterial GetNewMaterial()
        {
            return new C11Material(10, 10, 0, EnumMappingMode.material00, this.materialManager);
        }

        public void SetMaterial(IMaterial material)
        {
            this.CurrentMaterial = (C11Material)material;
        }

        public void SetMaterialManager(Engine.Graphics.MaterialManager materialManager)
        {
            this.materialManager = materialManager;
        }

        #endregion Public Methods
    }
}